#include <ntddk.h>

VOID
DriverUnload(_In_ PDRIVER_OBJECT DriverObject);

VOID
KdeferredRoutine(_In_ _KDPC* Dpc, _In_opt_ PVOID Context, _In_opt_ PVOID Argument1, _In_opt_ PVOID Argument2);

EXTERN_C
NTSTATUS
DriverEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ UNICODE_STRING RegistryPath)
{
	KDPC Dpc;

	KeInitializeDpc(&Dpc, KdeferredRoutine, nullptr);

	UNICODE_STRING Argument1Str1 = RTL_CONSTANT_STRING(L"Hello World");
	KeInsertQueueDpc(&Dpc, &Argument1Str1, nullptr);

	UNICODE_STRING Argument1Str2 = RTL_CONSTANT_STRING(L"Hello Kernel");
	KeInsertQueueDpc(&Dpc, &Argument1Str2, nullptr);

	DriverObject->DriverUnload = DriverUnload;

	KdPrint(("Driver loaded successful\n"));

	return STATUS_SUCCESS;
}

VOID
DriverUnload(_In_ PDRIVER_OBJECT DriverObject)
{
	KdPrint(("Driver unloaded successful\n"));
}

VOID
KdeferredRoutine(_In_ _KDPC* Dpc, _In_opt_ PVOID Context, _In_opt_ PVOID Argument1, _In_opt_ PVOID Argument2)
{
	if (Argument1 != nullptr) {
		KdPrint(("%ws", ((PUNICODE_STRING)Argument1)->Buffer));
	}

	KdPrint(("KdeferredRoutine successful execution"));
}